import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../m_chatroom.dart';
import '../../interface/chat_room_leaf_interface.dart';

class RelateRoomListPageModel extends ChatRoomChangeNotifier {
  @override
  observeMessage(int messageId, data) {}

  @override
  onRootProxyModelCreated() {
    getData();
  }

  int offset = 0;
  int snapshotId = 0;
  // List<Channel> data = [];
  String? get title {
    // return roomModel.channel!.title;
    return 'oomModel.channel!.title';
  }

  getData() async {
    // if (roomModel.channel != null) {
    // showLoadingDialog();
    // var name = roomModel.channel!.roomLabel.name;
    // var result = await RtcApi.instance.roomsByLabel(
    //     offset: offset, snapShotId: snapshotId, type: "HOT_HALL_$name");
    // dismissLoadingDialog();
    // if (!result.isSuccess) {
    //   showToast(T.current!.system_error);
    //   return;
    // }

    // RoomsByLabelData? roomData = result.data;
    // if (roomData != null) {
    //   var roomList = roomData.room;

    //   if (offset == 0) {
    //     data.clear();
    //     data.addAll(roomList);
    //   } else {
    //     data.addAll(roomList);
    //   }
    //   offset = roomData.offset.toInt();
    //   snapshotId = NumUtil.parseInt(roomData.snapshotId);
    //   notifyListeners();
    // }
    // }
  }

  // onItemPressed(BuildContext context, Channel item) {
  //   jumpToHallPage(
  //       context,
  //       item.channelId,
  //       item.hasPassword,
  //       item.owner.id.toInt() ==
  //           (UserManager.instance.currentUser?.id.toInt() ?? -1),
  //       joinSource: JoinSource.ROOM_RELATION_LIST);
  // }
}
